package org.wisdom.component;

import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * 自动添加版本信息 需要@Component暂不使用
 * 
 * @author 张智研
 * @date 2022/05/29 11:36
 **/
public class WebRequestMappingConfig implements WebMvcRegistrations {

    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        RequestMappingHandlerMapping handlerMapping = new ApiVersionRequestMappingHandlerMapping("v");
        handlerMapping.setOrder(0);
        return handlerMapping;
    }
}
